import request from '@/utils/request';

/**
 * @description 获取收货地址列表
 * @param {{page: string,limit: string}} queryObj
 */
export const getAddressList = data =>
    request({
        method: 'POST',
        url: '/frontend/consignee/list/',
        data:data,
    });

/**
 * @description 新增收货地址
 * @param {{is_default:string,name:string,phone:string,province:string,city:string,town:string,street:string,detail:string}} info
 */
export const addAddress = data =>
    request({
        method: 'POST',
        url: '/frontend/consignee/add/',
        data
    });

/**
 * @description 编辑地址
 * @param {{id:string,is_default:string,name:string,phone:string,province:string,city:string,town:string,street:string,detail:string}} info
 */
export const updateAddress = data =>
    request({
        method: 'POST',
        url: '/frontend/consignee/update/',
        data: data
    });

/**
 * @description 删除地址
 * @param {string} id
 */
export const deleteAddress = data =>
    request({
        method: 'POST',
        url: '/frontend/consignee/delete/',
        data: data,
    });
